<html>
<title>List | Health Promotion</title>
	<link rel="stylesheet" href="style.css"/>
	
<body class="pageBody">




<?php
	
	include("health_promo_class.php");
	$obj=new health_promo_class();
	if(!$obj->get_all_health_promo()){
	echo "error";
	exit();
	}
?>
	<form action = "health_promotion_home.php" method = "GET">
		<input type="submit" value="Back to Home" name="hphome"/>
	</form>
	<div id="divContent">
		<table class="listTable" width="90%" align="center" >
			<tr>
				<td colspan="100%" id="pageheader">
					All Health Promotions
				</td>
			</tr>
			<tr class="lheader">
				<td>ID</td>
				<td>Date</td><td>Venue</td><td>Topic</td>
				<td>Method</td><td>Target Audience</td><td>Number Of Audience</td>
				<td>Remarks</td><td>Month</td><td>Latitude</td>
				<td>Longitude</td><td>Image</td><td>Idcho</td>
				<td>Subdistrict ID</td>
			</tr>
<?php
	$row = $obj->fetch();
	$row_counter=0;
	while($row){
		if($row_counter%2==0){
			$style=" class='row1' ";
		}else{
			$style=" class='row2'  ";
		}	
	echo "<tr $style ><td>";
	echo $row["idhealth_promotion"];
	echo"</td>";
	echo "<td>";
	echo $row["date"];
	echo "</td>";
	echo "<td>";
	echo $row["venue"];
	echo "</td>";
	echo "<td>";
	echo $row["topic"];
	echo "</td>";
	echo "<td>";
	echo $row["method"];
	echo "</td>";
	echo "<td>";
	echo $row["target_audience"];
	echo "</td>";
	echo "<td>";
	echo $row["number_of_audience"];
	echo "</td>";
	echo "<td>";
	echo $row["remarks"];
	echo "</td>";
	echo "<td>";
	echo $row["month"];
	echo "</td>";
	echo "<td>";
	echo $row["latitude"];
	echo "</td>";
	echo "<td>";
	echo $row["longitude"];
	echo "</td>";
	echo "<td>";
	echo $row["image"];
	echo "</td>";
	echo "<td>";
	echo $row["idcho"];
	echo "</td>";
	echo "<td>";
	echo $row["subdistrict_id"];
	echo "</td>";
	echo "<td>";
	echo "<a href = 'health_promo_edit.php?id=$row[idhealth_promotion]'>edit</a>";
	echo "</td>";
	echo"</tr>";
	$row = $obj->fetch();
	$row_counter++;
	}
	
	
?>
	</table>
	</div>
	<br><br/><br/>
	
</body>
</html>